package com.eop.service.impl;

import java.util.Date;
import java.util.List;

import com.eop.dao.ISpecialInforDao;
import com.eop.entity.SpecialInfor;
import com.eop.service.ISpecialInforService;

public class SpecialInforServiceImpl implements ISpecialInforService {
	private ISpecialInforDao specialInforDao;

	public ISpecialInforDao getSpecialInforDao() {
		return specialInforDao;
	}

	public void setSpecialInforDao(ISpecialInforDao specialInforDao) {
		this.specialInforDao = specialInforDao;
	}

	@Override
	public void deleteSpecialInfor(SpecialInfor sr) {
		specialInforDao.delete(sr);
	}

	@Override
	public List<SpecialInfor> getSpecialInforByDate(Date date) {
		return specialInforDao.findAllByNamedQuery("sr.getSpecialByDate", date);
	}

	@Override
	public SpecialInfor getStageById(String id) {
		return specialInforDao.getById(id);
	}

	@Override
	public void saveSpecialInfor(SpecialInfor sr) {
		specialInforDao.saveOrUpdate(sr);
	}

	@Override
	public List<SpecialInfor> getSpecialInforByEvent(String eventId) {
		return specialInforDao.findAllByNamedQuery("sInfo.getSpecialByEvent",
				eventId);
	}

	@Override
	public List<SpecialInfor> getAllSpecialInformation() {
		return specialInforDao.findAllByNamedQuery("sInfo.getAllSpecialInfo");
	}

}
